package com.mr.orderclient.api.impl;

import com.mr.orderclient.api.ProductForOrderApi;
import com.mr.orderclient.entity.ProductInfo;
import com.mr.orderclient.vo.CartVO;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * Class: ProductForOrderApiImpl
 * User (作者):MRui
 * TODO (描述)：feign使用hystrix，当hystrix触发时(调用服务不可用则会走此方法)需要操作的内容
 * Date 2018-11-18 22:02
 */
@Component
public class ProductForOrderApiImpl implements ProductForOrderApi {


    @Override
    public List<ProductInfo> findList(List<String> ids) {
        List<ProductInfo> list = new ArrayList<>();
        ProductInfo productInfo = new ProductInfo();
        productInfo.setCategoryType(1);
        list.add(productInfo);
        return list;
    }

    @Override
    public void decreaseStock(List<CartVO> cartVOList) {

    }

    @Override
    public List<ProductInfo> findListForHystrix(List<String> ids) {
        return null;
    }

    @Override
    public String test() {
        return null;
    }
}
